import grails.test.*

class OrganizeControllerTests extends GrailsUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }


    void testOrganizeController(){
        def school = School.build()
        school.save()

        def orgc = new OrganizeController()
        orgc.params.name = 'name'
        orgc.params.description = 'description'
        orgc.session.school = school

        orgc.save()

        assertEquals '/organize/list' , orgc.response.redirectedUrl
        assertEquals  1 , Organize.countBySchool(school)
        
    
    }
}
